<template>
  <div>
    <el-card shadow="hover">
      <div style="padding-bottom: 10px;">
        <el-button type="primary"
                   @click="handleScriptError">点击测试触发程序错误</el-button>
        <el-button type="primary"
                   @click="handleAjaxError">点击测试触发ajax接口请求错误</el-button>
      </div>
      <e-table :data="errorList"
               :columns="columns"
               :page-show="false"
               :max-height="maxHeight"
               stripe
               border
               style="width: 100%"></e-table>
    </el-card>
  </div>
</template>

<script>
import { getError } from '@/api/common.api'
import columns from './columns'
export default {
  name: 'errorInfo',
  components: {},
  props: {},
  data () {
    return {
      // table表头参数
      columns
    }
  },
  watch: {},
  computed: {
    errorList () {
      return this.$store.state.app.errors
    },
    maxHeight () {
      const height = window.innerHeight
      return height - 198
    }
  },
  methods: {
    handleScriptError () {
      // console.log(admin)
      ''.map()
    },
    handleAjaxError () {
      getError().then(res => {
        // console.log(res)
      })
    }
  },
  created () { },
  mounted () { }
}
</script>
<style lang="scss" scoped>
</style>
